package com.ysh.smartplatform.mapper;

import com.ysh.smartplatform.pojo.SysLogininfor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 袁胜虎 on 2022/9/6 11:44
 */

public interface LoginLogMapper {
        @Insert("INSERT INTO sys_logininfor values (null,#{loginName},#{ipaddr},#{loginLocation},#{browser},#{os},#{status},#{msg},#{loginTime})")
        void addLog(SysLogininfor sysLogininfor);

        @Select("select * from sys_logininfor where login_name = #{loginName}")
        List<SysLogininfor> findByName(String loginName);

        @Delete("delete from sys_logininfor where info_id = #{id}")
        void deleteById(Long id);

        @Select("select * from sys_logininfor")
        List<SysLogininfor> findAllLoginLog();


}

